<template>
    <div>
        <!-- 我是part 组件 -->
        <partchild></partchild>
        <!-- <p>part-{{ msg }}-{{ count }}</p>
        <p><button @click="emitFn">子传父</button></p> -->
        <p>part组件: {{ gudong }}</p>
    </div>
</template>

<script>
import Partchild from './Partchild.vue';

export default {
    name: 'part',
    data() {
        return {
            userinfo: {
                username: '张继科',
                age: 35
            }
        };
    },
    props: ['msg', 'count'],
    emits: ['myevent'],
    inject: ['gudong'],
    components: {
        partchild: Partchild
    },
    created() {
        console.log('part-this', this);
    },
    methods: {
        emitFn() {
            // 子传父
            this.$emit('myevent', this.userinfo)
        }
    }

}

</script>
<style scoped></style>